import division from '@/router/modules/division'
import request from '@/utils/request'

const api_name = '/admin/division'

// 分页列表
export const GetDivisionListByPage = (page, limit, queryDto) => {
  return request({
    url: `${api_name}/findDivisionPage/${page}/${limit}`,
    method: 'get',
    params:queryDto
  })
}
//查询全部科室
export const findDivision = () => {
  return request({
    url: `${api_name}/findDivision`,
    method: 'get',
  })
}

// 新增科室的方法
export const SaveDivision = division => {
  return request({
      url: `${api_name}/saveDivision`,
      method: "post",
      data:division
  })
}

export const UpdateDivision = division => {
  return request({
      url: `${api_name}/updateDivision`,
      method: 'put',
      data:division
  })
}

export const DeleteDivisionById = (id) => {
  return request({
      url: `${api_name}/delDivision/` + id,
      method: 'delete'
  })
}
